<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>Simpla Admin</title>
		<link rel="stylesheet" href="${pageContext.request.contextPath}/backstage/resources/css/reset.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/backstage/resources/css/style.css" type="text/css" media="screen" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/backstage/resources/css/invalid.css" type="text/css" media="screen" />
	
		<script type="text/javascript" src="${pageContext.request.contextPath}/backstage/resources/scripts/jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/backstage/resources/scripts/simpla.jquery.configuration.js"></script>
		
		<script type="text/javascript" src="${pageContext.request.contextPath}/backstage/resources/scripts/facebox.js"></script>
		
		<script type="text/javascript">
			//$('a[rel*=modal]').facebox();
			jQuery(document).ready(function($) {
  				$('a[rel*=modal]').facebox() 
			})
		</script>
	</head>
	<body>
		<div id="main-content">
			<div class="content-box">
				<div class="content-box-header">
					<h3>
						消息
					</h3>
					<ul class="content-box-tabs">
						<li><a href="#tab1" class="default-tab">接受的消息</a></li> <!-- href must be unique and match the id of target div -->
						<li><a href="#tab2">发送消息</a></li>
					</ul>
					<div class="clear"></div>
				</div>
				<div class="content-box-content">
					<div class="tab-content default-tab" id="tab1">
						<table>
							<thead>
								<tr>
									<th>
										发送人
									</th>
									<th>
										紧急类型
									</th>
									<th>
										发送时间
									</th>
									<th>
										状态
									</th>
									<th>
										内容
									</th>
									<th>
										操作
									</th>
								</tr>
							</thead>
							<tfoot>
								<tr>
									<td colspan="6">
										<div class="pagination">
											<s:url id="firstPage" action="compAction.action">
												<s:param name="p.curPage" value="p.firstPage"/>
												<s:param name="p.count" value="p.count"/>
												<s:param name="p.pageSize" value="p.pageSize"/>
												<s:param name="p.sortOrder" value="p.sortOrder"/>
											</s:url>
											<s:url id="prevPage" action="compAction.action">
												<s:param name="p.curPage" value="p.prevPage"/>
												<s:param name="p.count" value="p.count"/>
												<s:param name="p.pageSize" value="p.pageSize"/>
												<s:param name="p.sortOrder" value="p.sortOrder"/>
											</s:url>
											<s:url id="nextPage" action="compAction.action">
												<s:param name="p.curPage" value="p.nextPage"/>
												<s:param name="p.count" value="p.count"/>
												<s:param name="p.pageSize" value="p.pageSize"/>
												<s:param name="p.sortOrder" value="p.sortOrder"/>
											</s:url>
											<s:url id="lastPage" action="compAction.action">
												<s:param name="p.curPage" value="p.lastPage"/>
												<s:param name="p.count" value="p.count"/>
												<s:param name="p.pageSize" value="p.pageSize"/>
												<s:param name="p.sortOrder" value="p.sortOrder"/>
											</s:url>
											<s:if test="p != null">
												<s:a href="%{firstPage}" title="第一页">&laquo; 第一页</s:a>
											</s:if>
											<s:if test="p.hasPrePage">
												<s:a href="%{prevPage}" title="上一页">&laquo; 上一页</s:a>
											</s:if>
											<s:if test="p.countPage > 0 && p.curPage > 0">
												<s:bean name="org.apache.struts2.util.Counter" id="counter">
													<s:param name="first" value="1" />
													<s:param name="last" value="p.countPage"/>
													<s:iterator status="s">
														<s:if test="#s.index + 1 == p.curPage">
															<a href="<s:url action="compAction.action"><s:param name="p.curPage" value="#s.index + 1"/><s:param name="p.count" value="p.count"/><s:param name="p.pageSize" value="p.pageSize"/><s:param name="p.sortOrder" value="p.sortOrder"/></s:url>" class="number current" title="<s:property value="#s.index + 1"/>"><s:property value="#s.index + 1"/></a>
														</s:if>
														<s:else>
															<a href="<s:url action="compAction.action"><s:param name="p.curPage" value="#s.index + 1"/><s:param name="p.count" value="p.count"/><s:param name="p.pageSize" value="p.pageSize"/><s:param name="p.sortOrder" value="p.sortOrder"/></s:url>" class="number" title="<s:property value="#s.index + 1"/>"><s:property value="#s.index + 1"/></a>
														</s:else>
													</s:iterator>
												</s:bean>
											</s:if>
											<s:if test="p.hasNextPage">
												<s:a href="%{nextPage}" title="下一页">下一页 &raquo;</s:a>
											</s:if>
											<s:if test="p != null">
												<s:a href="%{lastPage}" title="最后一页">最后一页 &raquo;</s:a>
											</s:if>
										</div>
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>
							<tbody>
							<s:iterator var="vo" value="info" status="s">
								<tr>
									<td>${vo.send}</td>
									<td>${vo.infotype}</td>
									<td>${vo.createdate}</td>
									<td>
										<s:if test="#vo.status == 1">
											可见
										</s:if>
										<s:if test="#vo.status == 0">
											不可见
										</s:if>
									</td>
									<td>
										<s:if test="#vo.content.length() > 10">
											${fn:substring(vo.content,0,10)}...
										</s:if>
										<s:if test="#vo.content.length() <= 10">
											${vo.content}
										</s:if>
									</td>
									<td>
										<a href="#" title="修改"><img src="${pageContext.request.contextPath}/backstage/resources/images/icons/pencil.png" alt="修改" /></a>
										<a href="#" title="删除"><img src="${pageContext.request.contextPath}/backstage/resources/images/icons/cross.png" alt="删除" /></a>
										<a href="#messages${s.index}" rel="modal" title="详情"><img src="${pageContext.request.contextPath}/backstage/resources/images/icons/hammer_screwdriver.png" alt="详情" /></a>
									</td>
								</tr>
								<div id="messages${s.index}" style="display: none">
									${vo.content}
								</div>
							</s:iterator>
							</tbody>
						</table>
					</div>
					<div class="tab-content" id="tab2">
						<form action="#" method="post">
							<fieldset>
								<p>
									<label>发送人</label>
									<select name="dropdown" class="small-input">
										<option value="attention">attention</option>
										<option value="information">information</option>
										<option value="success">success</option>
										<option value="error">error</option>
									</select> 
								</p>
								<p>
									<span class="input-notification">级别</span>
									<select name="dropdown" class="small-input">
										<option value="attention">attention</option>
										<option value="information">information</option>
										<option value="success">success</option>
										<option value="error">error</option>
									</select> 
								</p>
								<p>
									<label>发送内容</label>
									<textarea class="text-input textarea wysiwyg" id="textarea" name="textfield" cols="79" rows="15"></textarea>
								</p>
								<p>
									<input class="button" type="submit" value="Submit" />
								</p>
							</fieldset>
							<div class="clear"></div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
